home *** CD-ROM | disk | FTP | other *** search
Wrap
/* $Id: I3DShUti.H 1.71 1997/06/29 00:05:38 ERIC-G-PC Exp $ */ /*****************************************************************************\ * * * I3DShUti.h * * IShRasterBuffer definition * * IShRasterOffscreen definition * * IShLineArt definition * * IShUtilities definition * * * * Copyright (c) 1995-1196, Ray Dream, Inc. All rights reserved. * * * \*****************************************************************************/ #ifndef __I3DSHUTI__ #define __I3DSHUTI__ #ifndef __3DCOTYPE__ #include "3DCoType.h" #endif #ifndef __ISHSMP__ #include "IShSMP.h" #endif /****** Globally Unique Ids **************************************************/ DEFINE_GUID(IID_IIEnumChunk, 0x36E7B260L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShRasterBuffer, 0x38ACE200L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShRasterBufferPixelIterator, 0xa0daf130, 0x90e7, 0x11d0, 0xac, 0x10, 0x0, 0x60, 0x97, 0xb, 0xc5, 0x21); DEFINE_GUID(IID_IShRasterOffscreen, 0x3B30CDC0L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShLineArt, 0x3DF1C280L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShUtilities, 0x987FDA40L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShFileStream, 0x5C9601A8L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShGraphicDevice, 0x5C9601A9L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShMenuManager, 0x5C9601AAL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShActionManager, 0x5C9601ABL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShAction, 0x5C9601ACL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShMouseAction, 0x5C9601ADL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShTweener, 0x5C9601AEL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IInvertibleTweener, 0x5C9601AFL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_IShViewManager, 0x4926f780, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc); // Classes always available with Ray Dream Designer: DEFINE_GUID(CLSID_StandardRasterBuffer, 0x93A75022L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardRasterOffscreen, 0x93A75020L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardRasterMap, 0x93A75018L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardRasterSingleChunkOffscreen, 0x48e3d400, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc); // Offscreen with a single chunk (takes more RAM but is faster) DEFINE_GUID(CLSID_StandardFileStream, 0x5C9601A9L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardTokenStream, 0x28CAEEC0L, 0xA798, 0x11D0, 0x94, 0xE4, 0x00, 0x00, 0xC0, 0xE4, 0x45, 0x87); DEFINE_GUID(CLSID_StandardFacetMeshAccumulator, 0x14440e60, 0xc57e, 0x11d0, 0x94, 0xe5, 0x0, 0x0, 0xc0, 0xe4, 0x45, 0x87); DEFINE_GUID(CLSID_StandardFacetMeshIterator, 0x14440e61, 0xc57e, 0x11d0, 0x94, 0xe5, 0x0, 0x0, 0xc0, 0xe4, 0x45, 0x87); typedef void* BufferChunk; struct IShGraphicDevice; struct I3DShScene; DECLARE_INTERFACE(IShContext); DECLARE_INTERFACE(IShView); DECLARE_INTERFACE(IShControl); DECLARE_INTERFACE(IShPopup); struct ISh3DFileStream; struct IExternalView; /*****************************************************************************\ * IEnumChunk * * * * Chunk enumerator * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IEnumChunk DECLARE_INTERFACE_(IEnumChunk, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DEnumPatch methods STDMETHOD(Next) (THIS_ ULONG celt, BufferChunk** rgelt, ULONG* pceltFetched) PURE; STDMETHOD(Skip) (THIS_ ULONG celt) PURE; STDMETHOD(Reset) (THIS) PURE; STDMETHOD(Clone) (THIS_ IEnumChunk** ppenm) PURE; }; /*****************************************************************************\ * IShRasterBufferPixelIterator * * * * IShRasterBufferPixelIterator alows multiple routines to simultaneously * * use tha data of the associated IShRasterBuffer * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShRasterBufferPixelIterator DECLARE_INTERFACE_(IShRasterBufferPixelIterator, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShRasterBufferPixelIterator methods STDMETHOD(SetPosition) (THIS_ short h, short v) PURE; STDMETHOD(GoRight) (THIS) PURE; STDMETHOD(GoLeft) (THIS) PURE; STDMETHOD(GoDown) (THIS) PURE; STDMETHOD(GoUp) (THIS) PURE; STDMETHOD(Put) (THIS_ void* buffer) PURE; STDMETHOD(Get) (THIS_ void* buffer) PURE; STDMETHOD_(unsigned long,Get32) (THIS) PURE; STDMETHOD(Put32) (THIS_ long value) PURE; STDMETHOD(GBufferPut8) (THIS_ char value, short channel) PURE; STDMETHOD_(char, GBufferGet8) (THIS_ short channel) PURE; }; /*****************************************************************************\ * IShRasterBuffer * * * * IShRasterBuffer is a spooled buffer of chunks that are loaded and * * unload off the disk automaticaly. * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShRasterBuffer DECLARE_INTERFACE_(IShRasterBuffer, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShRasterBuffer methods STDMETHOD(Init) (THIS_ ULONG sizeH, ULONG sizeV, ULONG depth, ULONG planesCount, ULONG background) PURE; STDMETHOD(GetParameters) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* depth, ULONG* planesCount, ULONG* background) PURE; STDMETHOD(GetChunkInfo) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* rowBytes, ULONG* depth) PURE; STDMETHOD_(IEnumChunk*, EnumChunks) (THIS_ RECT3D* area) PURE; STDMETHOD(LockChunk) (THIS_ BufferChunk* chunk) PURE; STDMETHOD(UnlockChunk) (THIS_ BufferChunk* chunk) PURE; STDMETHOD_(void*, GetChunkData) (THIS_ BufferChunk* chunk) PURE; STDMETHOD(GetChunkRect) (THIS_ BufferChunk* chunk, RECT3D* rect) PURE; STDMETHOD_(short, GetDepth) (THIS) PURE; STDMETHOD(SetBackground) (THIS_ void* buffer) PURE; STDMETHOD(Erase) (THIS) PURE; STDMETHOD_(IShRasterBufferPixelIterator*, CreatePixelIterator) (THIS) PURE; STDMETHOD(SetPosition) (THIS_ short h, short v) PURE; STDMETHOD(GoRight) (THIS) PURE; STDMETHOD(GoLeft) (THIS) PURE; STDMETHOD(GoDown) (THIS) PURE; STDMETHOD(GoUp) (THIS) PURE; STDMETHOD(Put) (THIS_ void* buffer) PURE; STDMETHOD(Get) (THIS_ void* buffer) PURE; STDMETHOD_(unsigned long,Get32) (THIS) PURE; STDMETHOD(Put32) (THIS_ long value) PURE; }; /*****************************************************************************\ * IShRasterOffscreen * * * * IShRasterOffscreen implements a raster offscreen bitmap. It is * * automaticaly spooled to the disk if necessary. * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShRasterOffscreen DECLARE_INTERFACE_(IShRasterOffscreen, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShRasterBuffer methods STDMETHOD(Init) (THIS_ ULONG sizeH, ULONG sizeV, ULONG depth, ULONG planesCount, ULONG background) PURE; STDMETHOD(GetParameters) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* depth, ULONG* planesCount, ULONG* background) PURE; STDMETHOD(GetChunkInfo) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* rowBytes, ULONG* depth) PURE; STDMETHOD_(IEnumChunk*, EnumChunks) (THIS_ RECT3D* area) PURE; STDMETHOD(LockChunk) (THIS_ BufferChunk* chunk) PURE; STDMETHOD(UnlockChunk) (THIS_ BufferChunk* chunk) PURE; STDMETHOD_(void*, GetChunkData) (THIS_ BufferChunk* chunk) PURE; STDMETHOD(GetChunkRect) (THIS_ BufferChunk* chunk, RECT3D* rect) PURE; // IShRasterOffscreen methods //-- Init STDMETHOD(InitOffscreen) (THIS_ short sizeH, short sizeV, short depth) PURE; //-- Queries STDMETHOD_(short, GetDepth) (THIS) PURE; //-- Drawing STDMETHOD(BitBlits) (THIS_ IShGraphicDevice* destGD, RECT3D* source, RECT3D* dest) PURE; STDMETHOD(SetBackground) (THIS_ void* buffer) PURE; STDMETHOD(Erase) (THIS) PURE; STDMETHOD(SetPosition) (THIS_ short h, short v) PURE; STDMETHOD(GoRight) (THIS) PURE; STDMETHOD(GoLeft) (THIS) PURE; STDMETHOD(GoDown) (THIS) PURE; STDMETHOD(GoUp) (THIS) PURE; STDMETHOD(Put) (THIS_ void* buffer) PURE; STDMETHOD(Get) (THIS_ void* buffer) PURE; STDMETHOD(Save) (THIS_ char* fileName, long id) PURE; STDMETHOD(Load) (THIS_ char* fileName, Boolean storeExternally) PURE; STDMETHOD_(unsigned long,Get32) (THIS) PURE; STDMETHOD(Put32) (THIS_ long value) PURE; STDMETHOD(SetColorTable) (THIS_ unsigned long* colors, short size) PURE; STDMETHOD(GetColorTable) (THIS_ unsigned long* colors, short &size) PURE; }; /*****************************************************************************\ * IShLineArt * * * * IShLineArt is the equivalent of IShRasterOffscreen in the vector-based * * world: it allows you to draw resolution-independent curves. * * To be used with vector-based renderers. * * * * Pseudo "grammar" for drawing: * IMAGE = * GROUP * * GROUP = * BeginGroup * GROUP | COMPOUND | PATH | POINT 1 or more times * EndGroup * * COMPOUND = * BeginCompound * GROUP | COMPOUND | PATH | POINT 1 or more times * EndCompound * * PATH = * BeginPath * LineTo | BezierTo 1 or more times * EndPath * * POINT = DrawVertex | DrawHandle | DrawControl * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShLineArt DECLARE_INTERFACE_(IShLineArt, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShLineArt methods STDMETHOD(BeginGroup) (THIS) PURE; STDMETHOD(EndGroup) (THIS) PURE; STDMETHOD(BeginCompound) (THIS) PURE; // Use compounds to make holes STDMETHOD(EndCompound) (THIS) PURE; STDMETHOD(BeginPath) (THIS_ VECTOR2D* firstPoint) PURE; STDMETHOD(LineTo) (THIS_ VECTOR2D* secondPoint) PURE; STDMETHOD(BezierTo) (THIS_ VECTOR2D* secondPoint, VECTOR2D* thirdPoint, VECTOR2D* fourthPoint) PURE; STDMETHOD(EndPath) (THIS) PURE; STDMETHOD(DrawVertex) (THIS_ VECTOR2D* point) PURE; STDMETHOD(DrawHandle) (THIS_ VECTOR2D* point) PURE; STDMETHOD(DrawControl) (THIS_ VECTOR2D* point) PURE; }; /*****************************************************************************\ * IShKeyFrame * * * * Keyframe data * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShKeyFrame struct Riostream; DECLARE_INTERFACE_(IShKeyFrame, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShKeyFrame methods STDMETHOD(GetParam)(void *param,long type,BOOLEAN &changed) const PURE; STDMETHOD(SetParam)(const void *param,long type) PURE; STDMETHOD_(long,GetType)() const PURE; STDMETHOD_(IShKeyFrame *,Clone)() const PURE; STDMETHOD(Read)(Riostream& stream) PURE; STDMETHOD(Write)(Riostream& stream) const PURE; STDMETHOD(Copy)(const IShKeyFrame &from) PURE; STDMETHOD(LinearInterpolate)(const NUM3D &lamda,const IShKeyFrame &kf1,const IShKeyFrame &kf2) PURE; }; /*****************************************************************************\ * IShTweener * * * * Tweener data * * * \*****************************************************************************/ struct IShTweener; struct IShKeyFrame; struct XTweenerChainLink { IShKeyFrame *fKeyFrame; XTweenerChainLink *fPrev; XTweenerChainLink *fNext; long fTime; IShTweener *fTweener; }; class LRect; #undef INTERFACE #define INTERFACE IShTweener DECLARE_INTERFACE_(IShTweener, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShTweener methods STDMETHOD_(int,IsEqual)(THIS_ const IShTweener *other) const PURE; STDMETHOD_(IShTweener*,Clone)(THIS) const PURE; STDMETHOD(DoTween)(THIS_ IShKeyFrame *res,long time,XTweenerChainLink *alink) const PURE; STDMETHOD(Draw)(THIS_ IShGraphicDevice* aGD,const LRect* area,const LRect *where) const PURE; STDMETHOD_(IShTweener*,Edit)(THIS_ XTweenerChainLink* chainLink) const PURE; }; #undef INTERFACE #define INTERFACE IInvertibleTweener DECLARE_INTERFACE_(IInvertibleTweener, IUnknown) { STDMETHOD(Inverse)() PURE; }; /*****************************************************************************\ * IShUtilities * * * * Misc. OS utilities provided by the shell. * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE IShUtilities // GetUIColor() constants: enum {kShMain3DLook = 1, kShHilite3DLook = 2, kShShadow3DLook = 3, kShDark3DLook = 4, kShLightColor = 10, // Light source color kShCameraColor = 11, // Camera color kShSelectionColor = 12, // Selection & Paint Shapes color kShGridColor = 13, // Grid color kShActiveGridColor = 14, // Active Grid (Drawing Plane) color kShOutlineColor = 15, // Grid outline color kShProdFrameColor = 16, // Production Frame color kShBackgrndColor = 17, // Perspective background color kShKeyFrameColor = 18, // Key Frame color kShWireframeColor = 19, // Wireframe color kShMotionPathColor = 20, // Motion Path color kShBBoxColor = 21, // Bounding Box color kShProjectionColor = 22, // Projection Color kShColorModes = 23 // Special: Red=Motion Path color mode, Green=BBox color mode, Blue=Projection color mode }; class XTimeBased; DECLARE_INTERFACE_(IShUtilities, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShUtilities methods STDMETHOD(YieldProcesses) (THIS_ ULONG ticks) PURE; STDMETHOD_(ULONG, TickCount) (THIS) PURE; STDMETHOD_(ULONG, Random) (THIS) PURE; STDMETHOD(RandomSeed) (THIS_ ULONG newSeed) PURE; STDMETHOD(GetSerialNumber) (THIS_ char* serialNumber) PURE; //-- Progression bar STDMETHOD(ProgressStart) (THIS_ char* prompt, ULONG maxValue) PURE; STDMETHOD(ProgressIncrement) (THIS_ ULONG increment) PURE; STDMETHOD(ProgressNewValue) (THIS_ ULONG newValue) PURE; STDMETHOD(ProgressDone) (THIS) PURE; //-- Failure Handling STDMETHOD(Failure) (THIS_ short error, long message) PURE; STDMETHOD_(void*, GetGTopHandler) (THIS) PURE; STDMETHOD_(void*, GetSetJmpAddress) (THIS) PURE; //-- Memory Management STDMETHOD_(void*, Malloc) (THIS_ unsigned long size) PURE; STDMETHOD_(void*, Calloc) (THIS_ unsigned long nmemb, unsigned long size) PURE; STDMETHOD_(void*, Realloc) (THIS_ void* ptr, unsigned long size) PURE; STDMETHOD(Free) (THIS_ void* ptr) PURE; //-- Instanciation STDMETHOD(CoCreateInstance) (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv) PURE; //-- Get COM helper (API level 6) STDMETHOD_(void*, GetCOMMap) (THIS_ void *map) PURE; //-- Misc. Utilities (API level 6) STDMETHOD(GetShellVersion) (THIS_ ULONG* major, ULONG* minor, char* stage, ULONG* stageCount) PURE; STDMETHOD_(ULONG, GetAPINumber) (THIS) PURE; STDMETHOD(GetIndString) (THIS_ char* str, short strID, short itemNo) PURE; STDMETHOD_(BOOLEAN, CheckRegistration) (THIS_ ULONG familyID, ULONG classID, char* productKey, char* productName) PURE; STDMETHOD(GetRegistrationName) (THIS_ char* name) PURE; STDMETHOD(GetRegistrationOrganization) (THIS_ char* name) PURE; //--KeyFrame generation STDMETHOD_(IShKeyFrame *,CreateKeyFrame)(long itsType) PURE; STDMETHOD_(IShKeyFrame *,ReadKeyFrame)(ISh3DFileStream *stream) PURE; STDMETHOD(WriteKeyFrame)(const IShKeyFrame *,ISh3DFileStream *stream) PURE; //--Gestalt STDMETHOD(Gestalt)(THIS_ void *data,ULONG id) PURE; //--Tweener STDMETHOD_(IShTweener*,CreateTweener)(long itsType) PURE; //--Misc. STDMETHOD_(short, DoAlert)(short alertID, // ID of the ALRT resource char* arg0, char* arg1, char* arg2) PURE; // Strings to be subsituted to '^0', '^1' and '^2' STDMETHOD(SetupResource) (THIS_ long* oldMap) PURE; // Obsolete. do not use. STDMETHOD(RestoreResource) (THIS_ long* oldMap) PURE; // Obsolete. do not use. //Import Reports STDMETHOD(ResetImportReport) (THIS_ ) PURE; STDMETHOD(AddImportProblem) (THIS_ short msgIndex, char* substitutionString, Boolean allowMultipleEntries) PURE; STDMETHOD(ShowImportReport) (THIS_ short dialogID,short strListID) PURE; STDMETHOD(GetUIColor) (THIS_ short uicolor, RGBCOLOR3D* color) PURE; STDMETHOD(WriteComponent) (THIS_ const IShTweener* aTweener,ISh3DFileStream* stream) PURE; STDMETHOD_(IShTweener*, ReadComponent) (THIS_ ISh3DFileStream* stream) PURE; //-- Misc. (API level 9) // Opens a modal dialog based on a View resource and a PMap resource. // IMPORTANT: The top view must be a TWindow with a Class Name of 'TStdPMAPWindow'. // The value returned is the ID of the item that dismissed the dialog. STDMETHOD_(long, DoDialog)(short viewAndPMapID, // ID of the View and PMap resources void* dataBuffer, // Data buffer used to communicate with the dialog. Works like I3DExDataExchanger: the PMap resource describes the format of the Data Buffer void (*onMessageCallBack) (long messageID, long sourceID, PLATFORMEVENT* event, IShView* topWindow, void* privData), // This call-back will be called everytime an event occur, so your code can react. Can be NULL. void* privData) PURE; // Callback's private data // Instanciation of external modules (See I3DExModule) STDMETHOD(EditInNewWindow) (THIS_ long module, void* elem, I3DShScene* scene, void** window) PURE; STDMETHOD(OpenImage) (THIS_ char* filename, long* format) PURE; STDMETHOD(SaveImage) (THIS_ char* filename, long* format) PURE; STDMETHOD(GetResource) (THIS_ long family, long classID, long resType, void** data) PURE; STDMETHOD(SetupResources)(THIS_ long family, long classID, void** oldResources) PURE; STDMETHOD(RestoreResources)(THIS_ void* oldResources) PURE; }; /*****************************************************************************\ * IShFileStream * * * * Simple stream interface to provide basic file access services. * * * \*****************************************************************************/ // mode constants: #define kShStreamIn 1 #define kShStreamOut 2 // Seek direction constants: #define kShStreamBegin 0 #define kShStreamCurrent 1 #define kShStreamEnd 2 #undef INTERFACE #define INTERFACE IShFileStream DECLARE_INTERFACE_(IShFileStream, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShFileStream methods STDMETHOD(InitFileStream) (THIS_ char* fileName, ULONG mode) PURE; //-- Seek STDMETHOD_(ULONG, Tell) (THIS) PURE; STDMETHOD(Seek) (THIS_ ULONG offset, short direction) PURE; //-- Bynary io STDMETHOD(Read) (THIS_ char* s, ULONG n) PURE; STDMETHOD(Write) (THIS_ char* s, ULONG n) PURE; STDMETHOD(Append) (THIS_ ULONG n) PURE; //-- Text io STDMETHOD(Get) (THIS_ char* c) PURE; STDMETHOD(GetString) (THIS_ char* str, ULONG count, char delim) PURE; STDMETHOD(GetLine) (THIS_ char* str, ULONG count) PURE; STDMETHOD(GetLong) (THIS_ long* num) PURE; STDMETHOD(GetDouble) (THIS_ Double* num) PURE; STDMETHOD(Put) (THIS_ char c) PURE; STDMETHOD(PutString) (THIS_ char* str) PURE; STDMETHOD(PutLine) (THIS_ char* str) PURE; STDMETHOD(PutEOL) (THIS) PURE; STDMETHOD(PutLong) (THIS_ long num) PURE; STDMETHOD(PutDouble) (THIS_ Double num) PURE; STDMETHOD(PutBack) (THIS_ char c) PURE; //-- Error STDMETHOD_(BOOLEAN, Good) (THIS) PURE; STDMETHOD_(BOOLEAN, Fail) (THIS) PURE; STDMETHOD_(BOOLEAN, Eof) (THIS) PURE; //-- Misc. STDMETHOD(SetMacOSInfo) (THIS_ ULONG creator, ULONG type) PURE; STDMETHOD_(ULONG, GetFileSize) (THIS) PURE; }; /*****************************************************************************\ * IShGraphicDevice * * * * Cross platform graphic device to draw on screen * * * \*****************************************************************************/ // Pen Type constants: #define kShGDSolid 0 #define kShGDDash 1 #define kShGDDot 2 // Pen Mode constants: #define kShGDXor 3 #define kShGDCopy 4 #define kShGDBic 5 // Text Justification constants: enum {kShJustLeft=0, kShJustCenter=1, kShJustRight=2, kShMiddleCut=4, kShEndCut=8}; // Text Mode constants: enum {kShTMNone=0, kShTMEraseFirst=1, kShTMDoNotWrap=2, kShTMCenterVert=4, kShTMTranslateMetaChar=8}; #undef INTERFACE #define INTERFACE IShGraphicDevice DECLARE_INTERFACE_(IShGraphicDevice, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShGraphicDevice methods STDMETHOD(MoveTo)(THIS_ long hh,long vv) PURE; STDMETHOD(LineTo)(THIS_ long hh,long vv) PURE; STDMETHOD(SetPen)(THIS_ short aPenMode,short aPenType,short size,unsigned short rr,unsigned short gg,unsigned short bb) PURE; STDMETHOD(ResetPen)(THIS) PURE; STDMETHOD(DrawLine)(THIS_ long h1, long v1, long h2, long v2) PURE; STDMETHOD(EraseRect)(THIS_ const LRECT3D& theRect) PURE; STDMETHOD(InvertRect)(THIS_ const LRECT3D& theRect) PURE; STDMETHOD(FrameRect)(THIS_ const LRECT3D& theRect) PURE; STDMETHOD(FillRect)(THIS_ const LRECT3D& theRect,unsigned short rr,unsigned short gg,unsigned short bb) PURE; STDMETHOD(DrawString)(THIS_ const LRECT3D& theRect, const char* astring, short just, short mode) PURE; STDMETHOD(DrawOffscreen)(THIS_ const IShRasterOffscreen *aOffscrn, const RECT3D &srcRect, const LRECT3D &dstRect) PURE; STDMETHOD(PlotIcon)(THIS_ long hh,long vv,short dh,short dv,short index) PURE; STDMETHOD_(long, StringWidth) (THIS_ const char* string) PURE; STDMETHOD(FrameOval)(THIS_ const LRECT3D& theRect) PURE; STDMETHOD(FillOval)(THIS_ const LRECT3D& theRect,unsigned short rr,unsigned short gg,unsigned short bb) PURE; STDMETHOD(Draw32BitMap)(THIS_ const LPOINT3D &dst,long *pixels,long sizeX,long sizeY,long rowbytes) PURE; STDMETHOD(GetActualSystemPtr)(THIS_ void*& data) PURE; // Returns the platform's specific data // If you do cross-platform development, you should NOT use this. // MacOS: 'data' should be a CGrafPtr // WinTel: 'data' should be a HDC }; // Preset clipboard types #define kShTreeElementClipboard IDTYPE('T','R','E','E') #define kShObjectClipboard IDTYPE('I','N','S','T') DECLARE_INTERFACE_(IShMenuManager, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShMenuManager STDMETHOD(EnableCheckMenu) (THIS_ long anAction, Boolean canDo, Boolean checkIt) PURE; STDMETHOD(EnableMenu) (THIS_ long anAction, Boolean canDo) PURE; STDMETHOD(DeleteMenuItem) (THIS_ short menu, short item) PURE; STDMETHOD(AddMenuItem) (THIS_ short menu, char* commandName, short after, long action) PURE; STDMETHOD(AddSubMenuItem) (THIS_ short menu, char* commandName, short submenu, short after) PURE; STDMETHOD(ClipboardGetData) (THIS_ long itsType, void** data) PURE; // See preset types above STDMETHOD(ClipboardSetData) (THIS_ long itsType,void *itsData,void deleteProc(void*)) PURE; STDMETHOD(EnableCheckToolIcon) (THIS_ short tool, Boolean enabled, Boolean checked) PURE; }; DECLARE_INTERFACE_(IShAction, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShAction methods STDMETHOD(Do)(THIS) PURE; STDMETHOD(Undo)(THIS) PURE; STDMETHOD(Redo)(THIS) PURE; STDMETHOD_(BOOLEAN, WillCauseChange)(THIS) PURE; STDMETHOD_(BOOLEAN, CanUndo)(THIS) PURE; STDMETHOD_(IShView*, GetViewToRedraw)(THIS) PURE; // Gives the opportunity to the IShAction to tell // the Shell that the returned view should be redrawn // after Do/Undo/Redo. Return NULL if nothing should occur. STDMETHOD(GetName)(THIS_ char* name) PURE; }; // Tracking Stages for IShMouseAction::Track #define kShBeginTracking 0 #define kShContinueTracking 1 #define kShFinishTracking 2 DECLARE_INTERFACE_(IShMouseAction, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShMouseAction methods STDMETHOD(Do)(THIS) PURE; STDMETHOD(Undo)(THIS) PURE; STDMETHOD(Redo)(THIS) PURE; STDMETHOD_(BOOLEAN, WillCauseChange)(THIS) PURE; STDMETHOD_(BOOLEAN, CanUndo)(THIS) PURE; STDMETHOD(GetName)(THIS_ char* name) PURE; STDMETHOD(Track)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,const LPOINT3D &cur,BOOLEAN moved) PURE; // Return E_ABORT if the tracking should stop and the Action been discarded STDMETHOD(Feedback)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,const LPOINT3D &cur,BOOLEAN moved,Boolean show) PURE; STDMETHOD_(IShView*, GetViewToRedraw)(THIS) PURE; // Gives the opportunity to the IShMouseAction to tell // the Shell that the returned view should be redrawn // after Do/Undo/Redo. Return NULL if nothing should occur. STDMETHOD(Constrain)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,LPOINT3D &cur,BOOLEAN moved) PURE; }; DECLARE_INTERFACE_(IShActionManager, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShActionManager methods STDMETHOD(PostAction) (THIS_ IShAction* action,long actionNbr,IShContext *context) PURE; STDMETHOD(PostMouseAction) (THIS_ IShMouseAction* action,long actionNbr,IShContext *context, IShView *view,const LPOINT3D &mouse) PURE; STDMETHOD_(BOOLEAN, IsOptionDown) (THIS) PURE; STDMETHOD_(BOOLEAN, IsShiftDown) (THIS) PURE; STDMETHOD_(BOOLEAN, IsCommandDown) (THIS) PURE; }; // The View Manager is a set of callbacks that help you manipulate views in a sophisticated manner. // The calls using a IShControl* parameter are more restricted: they should be used with views // of type TButton, TCheckBox, TControl, TEditText, TNumberText, TFixedNumberText, T3DUnitNumberText, // TPopup, TRadio, TSlider, and TStaticText in AdLib. If you know you are dealing with one of these, then // cast your IShView* pointer into IShControl* and call the proc. If the view was not of a compatible // type, then an error code will be returned. // // The View Manager is especially usefull when using the callback procedure of the IShUtilities::DoDialog() proc: // often, one needs to enable or disable items in a dialog, or change text or values. Using the 'topWindow' // parameter of the callback, call gViewManager->FindSubView(topWindow, IDTYPE(....)) to get a pointer on the dialog item // you are interested in. Then use this pointer to set or get data with the dialog item using the View Manager again. // // The View Manager can of course be used in any situation when the Shell gives you a IShView pointer to play with. // Just remember that a IShView pointer is a private pointer owned by the Shell (it is NOT a IUnknown object), and // that you cannot do much more with it than passing it back to the Shell when needed (like when using the View Manager // for example). DECLARE_INTERFACE_(IShViewManager, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // IShViewManager methods STDMETHOD_(IShView*, FindSubView) (THIS_ IShView* view, long theID) PURE; STDMETHOD_(IShView*, GetSuperView) (THIS_ IShView* view) PURE; STDMETHOD(SetBounds) (THIS_ IShView* view, LRECT3D* newBounds, BOOLEAN forceRedraw) PURE; STDMETHOD(GetBounds) (THIS_ IShView* view, LRECT3D* bounds) PURE; STDMETHOD(Enable) (THIS_ IShView* view, BOOLEAN enable, BOOLEAN forceRedraw) PURE; STDMETHOD_(BOOLEAN, IsEnabled) (THIS_ IShView* view) PURE; STDMETHOD(Show) (THIS_ IShView* view, BOOLEAN show, BOOLEAN forceRedraw) PURE; STDMETHOD_(BOOLEAN, IsShown) (THIS_ IShView* view) PURE; STDMETHOD(Dim) (THIS_ IShView* view, BOOLEAN dim, BOOLEAN forceRedraw) PURE; STDMETHOD_(BOOLEAN, IsDimmed) (THIS_ IShView* view) PURE; STDMETHOD(ForceRedraw) (THIS_ IShView* view) PURE; // Post an update event for this view (view will be redrawn later) STDMETHOD(RedrawNow) (THIS_ IShView* view) PURE; // Draw the view immediately STDMETHOD(InvalidateRect) (THIS_ IShView* view, LRECT3D* rect) PURE; STDMETHOD(ValidateRect) (THIS_ IShView* view, LRECT3D* rect) PURE; STDMETHOD(ExposeRect) (THIS_ IShView* view, LRECT3D* rect, LPOINT3D* minToSee, BOOLEAN forceRedraw) PURE; // Scroll 'rect' into view (provided the view is in a scroller) STDMETHOD(GetVisibleLocalBounds) (THIS_ IShView* view, LRECT3D* rect) PURE; // Returns the part of the view visible withing the super-view's frame. STDMETHOD_(IShGraphicDevice*, GetGraphicDevice) (THIS_ IShView* view) PURE; // You must release the graphic device after use //IShControl methods STDMETHOD(Flash) (THIS_ IShControl* control) PURE; STDMETHOD(SetHilite) (THIS_ IShControl* control, BOOLEAN hilite, BOOLEAN forceRedraw) PURE; STDMETHOD_(BOOLEAN, IsHilited) (THIS_ IShControl* control) PURE; STDMETHOD(SetValues) (THIS_ IShControl* control, long value, long min, long max, BOOLEAN forceRedraw) PURE; STDMETHOD(GetValues) (THIS_ IShControl* control, long* value, long* min, long* max) PURE; STDMETHOD(SetText) (THIS_ IShControl* control, char* string, BOOLEAN forceRedraw) PURE; STDMETHOD(GetText) (THIS_ IShControl* control, char* string) PURE; //IShPopup methods STDMETHOD(GetCurrentItem) (IShPopup *popup,short &index) PURE; STDMETHOD(SetCurrentItem) (IShPopup *popup,short index,BOOLEAN redraw) PURE; STDMETHOD(RemoveAllItems) (IShPopup *popup) PURE; STDMETHOD(InsertItemLast) (IShPopup *popup,const char *name) PURE; STDMETHOD(Rebuild) (IShPopup *popup) PURE; //IExternalView methods STDMETHOD(GetExternalView) (IShView *view,IExternalView *&extView) PURE; // Misc methods STDMETHOD(GetActualSystemWindowPtr) (IShView *view,void *&awindow) PURE; // Returns the platform's specific data. (a HWND on Wintel, a WindowPtr on a Mac, etc.) // If you do cross-platform development, you should NOT use this. // MacOS: 'awindow' should be a WindowPtr // WinTel: 'awindow' should be a HWND }; #endif